﻿
<div class="mt50" ng-controller="AccessHistoryController">
    <div class="clearfix">
        <p class="fleft">Date From:
            <input type="text" datepicker-popup="{{format}}" ng-model="dfrom" is-open="openedDayForm" max-date="'2020-06-22'" datepicker-options="dateOptions" ng-required="true" close-text="Close" />
            <button type="button" class="btn btn-default colorBlack" ng-click="openDayFrom($event)"><i class="glyphicon glyphicon-calendar"></i></button>
        </p><span class="fleft pd5">~</span>
        <p class="fleft">Date To:
            <input type="text" datepicker-popup="{{format}}" ng-model="dto" is-open="openedDayTo" max-date="'2020-06-22'" datepicker-options="dateOptions" ng-required="true" close-text="Close" />
            <button type="button" class="btn btn-default colorBlack" ng-click="openDayTo($event)"><i class="glyphicon glyphicon-calendar"></i></button>
        </p>
    </div>


    <div class="clearfix">
        <div class="mb10 mr50 fleft">
            {{texts['lb-user-name']}}:
            <select class="CBB w150" ng-model="myUsers">
                <option value="">All user</option>
                <option ng-repeat="users in rowsUserName" value="{{ users.Name }}">{{users.Name}}</option>
            </select>
        </div>
        <button>Search</button>
    </div>
    <p class="clearfix">
        {{texts['lb-page-display']}}:
        <select ng-model="myPage" class="CBB w70px" ng-change="update()">
            <option ng-selected="">30</option>
            <option>50</option>
            <option>100</option>
            <option>300</option>
            <option>500</option>
        </select>
    </p>
    <div class="mb20 mh195 clearfix">
        <table class="tableKind-01 table-AccessHistory w760" >
            <tr>
                <th>{{texts['lb-user-name']}}</th>
                <th>{{texts['lb-login-time']}}</th>
                <th>{{texts['lb-logout-time']}}</th>
                <th>{{texts['lb-source-ip']}}</th>
                <th>{{texts['lb-host-name']}}</th>
            </tr>
            <tr ng-repeat="rows in pagedItems[currentPage]| filter : myUsers">
                <td>{{rows.Name}}</td>
                <td>{{rows.LoginTime}}</td>
                <td>{{rows.LogoutTime}}</td>
                <td>{{rows.SourceIp}}</td>
                <td>{{rows.HostName}}</td>
            </tr>
        </table>
    </div>

    <div class="center w760 clearfix">
        <div class="pagination">
            <p class="fleft pd5">{{texts['lb-page']}}:</p>
            <ul class="listNgang pagination">
                <li ng-class="{disabled: currentPage == 0}">
                    <a href ng-click="prevPage()">« Prev</a>
                </li>
                <li ng-repeat="n in range(pagedItems.length)"
                    ng-class="{active: n == currentPage}"
                    ng-click="setPage()">
                    <a href ng-bind="n + 1">1</a>
                </li>
                <li ng-class="{disabled: currentPage == pagedItems.length - 1}">
                    <a href ng-click="nextPage()">Next »</a>
                </li>
            </ul>
        </div>
    </div>

</div>
